<?php 
namespace App\Services;

use App\Facades\Infra\UserManage;

class UserService{
	public function getUsers(){

		$openId = session('wechat.oauth_user')->getId();

		$conditions['form_openid'] = $openId;

		return UserManage::getUsers($conditions)->get();
	}

	public function getUser($data){

		$conditions['id'] = $data['id'];

		return UserManage::getUser($conditions);
	}

	public function getUserByGiRecord($data)
	{
		$conditions['wechat_user_id'] = $data['id'];

		return UserManage::getUserByGiRecord($conditions)->get();
	}

	public function getUserByWeight($data){

		$conditions['wechat_user_id'] = $data['id'];

		return UserManage::getUserByWeight($conditions)->get();
	}
}